@extends('prelist')
@section('left')
@parent
@endsection
@section('right')
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/shoplist">店铺操作</a><span class="crumb-step">&gt;</span><span class="crumb-name">添加菜品</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
                <form action=""   method="post" id="myform" name="myform" enctype="multipart/form-data">
                {!!csrf_field()!!}
                    <table class="insert-tab" width="100%">
                        <tbody>
                            <tr>
                                <th><i class="require-red">*</i>所属店铺：</th>
                                <td>
                                    <select name="sid" id="sid" onchange="bian()">
                                        <option value ="0">请选择店铺...</option>
                                        @foreach($stores as $s)
                                        <option value="{{$s->sid}}">{{$s->sname}}</option>
                                        @endforeach
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>所属分类：</th>
                                <td>
                                    <select name="lid" id="lid">

                                    </select>
                                </td>
                            </tr>
                            <script>
                                function bian(){
                                    var cai = [
                                        '',
                                        ['凉菜','热菜'],
                                        ['热菜','凉菜'],
                                        ['炒菜','凉拌'],
                                        ['快餐','甜点']
                                    ];
                                    var sid = document.getElementById('sid');
                                    var lid = document.getElementById('lid');
                                    //alert(sid.value);
                                    var lname = cai[sid.value];
                                    var str = '';
                                    for(var i=0; i<2;i++){
                                        str = str + '<option>' + lname[i] + '</option>';
                                    }
                                    lid.innerHTML = str;
                                }
                            </script>
                            

                            <tr>
                                <th><i class="require-red">*</i>菜品名称：</th>
                                <td>
                                    <input class="common-text required" id="title"
                                    name="mname" size="6" value="" type="text">
                                </td>
                            </tr>
                            
                            <tr>
                                <th><i class="require-red">*</i>菜品价格：</th>
                                <td>
                                    <input class="common-text required" id="title"
                                    name="mprice" size="6" value="" type="text">
                                </td>
                            </tr>

                            <tr>
                                <th></th>
                                <td>
                                    <input class="btn btn-primary btn6 mr10" value="发布" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </form>
            </div>
        </div>
@endsection
